<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>模拟器监控管理 </title>
<@fm.header />
<script type="text/javascript" src="/resources/js/common.js"></script>
<script type="text/javascript" src="/resources/js/simuatorStatusInfo/simuatorStatusInfo.js"></script>
</head>
<body class="cmp-list-body">
<div id="tb" style="padding:3px">
	<span>IP</span>
	<input id="sclientIpId" class="easyui-textbox" style="width: 155px;" name="clientIp"/>
	<span>mac</span>
	<input id="macId" class="easyui-textbox" style="width: 155px;" name="mac"/>
	<span>设备号</span>
	<input id="suuidId" class="easyui-textbox" style="width: 155px;" name="uuid"/>
	<span>业务包版本</span>
	<input id="bizVerId" class="easyui-textbox" style="width: 155px;"/>
	<span>系统版本</span>
	<input id="sysVerId" class="easyui-textbox" style="width: 155px;"/>
	<span>心跳版本</span>
	<input id="heartVerId" class="easyui-textbox" style="width: 155px;"/>
	<span>任务状态:</span>
	<select class="easyui-combobox" id="taskStatusId" panelHeight="auto" style="width:155px" >
	        <option value="" selected>全部</option>
            <option value="0">在空闲</option>
        	<option value="1">下发任务</option>
        	<option value="2">接受任务</option>
        	<option value="3">任务超时</option>
        	<option value="4">任务完成</option>
    </select>
	<span>在线状态:</span>
	<select class="easyui-combobox" id="statusId" panelHeight="auto" style="width:155px" >
	        <option value="" selected>全部</option>
            <option value="1">在线</option>
        	<option value="2">离线</option>
    </select>
    <span>机型:</span>
	<select class="easyui-combobox" id="modelId" panelHeight="auto" style="width:155px" >
	        <option value="" selected>全部</option>
            <option value="Redmi Note 4">Redmi Note 4</option>
        	<option value="K5703QS">K5703QS</option>
    </select>
    <a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch();">查询</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="upgradePack();">升级母包</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="closePhone();">关闭手机</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="restartPhone();">重启手机</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="openFlashlight();">打开手电筒</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="clearStatus();">清理任务状态</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="syncStatus();">同步状态</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="clearOffline();">清理离线手机</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="clearOfflineForVer();">按版本离线手机</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="restartBusy();">一直忙碌手机重启</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="upgradeHeartApk();">升级心跳包</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="upgradeSystemApk();">升级系统包</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="upgradeSystemApkByModel();">按类型升级系统包</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="searchSysApkTask();">查询系统包任务</a>
</div>

<table id="tt" title="模拟器监控管理" 
	 toolbar="#tb" rownumbers="true" idField="uuid" singleSelect="false" pagination="true" 
	    fitColumns="true" selectOnCheck="true" data-options="onLoadSuccess:dataOnLoadSuccess" pageSize="100" pageList="[100,200,400,800,1600]">  
    <thead>
        <tr>
            <th data-options="field:'id',checkbox:true"></th>
            <th align="center" width="10%" field="cabinet">机柜</th>
		    <th align="center" width="14%" field="clientIp">客户端IP</th>
		    <th align="center" width="7%" field="mac">客户端MAC</th>
		    <th align="center" width="5%" field="model">手机类型</th>
		    <th align="center" width="10%" field="bizVer">业务包版本</th>
		    <th align="center" width="5%" field="heartVer">心跳包版本</th>
		    <th align="center" width="5%" field="sysVer">系统包版本</th>
		    <th align="center" width="5%" field="status" formatter="onLineFormatter">在线状态</th>
		    <th align="center" width="5%" field="taskStatus" formatter="taskStatuFormatter" >任务状态</th>
		    <th align="center" width="10%" field="taskType" formatter="taskTypeFormatter">任务类型</th>
		    <th align="center" width="8%" field="modifyDate">更新时间</th>
		    <th align="center" width="15%" field="uuid">设备号</th>
        </tr>
    </thead>   
</table>

<div id="upgradeWin" class="easyui-window" title="模拟器监控管理|升级母包" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:500px;height:450px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <div data-options="region:'north'" style="height:110px">
             <form id="upgradeForm"  method="post">
	           <table>
	               <tr>
	                   <td align="left">从版本</td>
	                   <td>
	                      <input class="easyui-textbox" type="text" name="fromVersion" id="fromVersionId" readonly="true" />
	                   </td>
	                   <td align="left">升级到</td>
	                   <td>
	                       <input class="easyui-textbox" type="text" name="toVersion" id="toVersionId" readonly="true" />
	                   </td>
	               </tr>
	               <tr>
	                    <td align="left">是否强制</td>
	                    <td>
                           <select class="easyui-combobox" id="force" panelHeight="auto" style="width:155px" >
                                    <option value="0">不强制</option>
                                    <option value="1">强制</option>
                            </select>
                        </td>
                    </tr>    
	           </table>
             </form>
             <div style="padding: 25px; text-align: center;">
               <a href="#" class="easyui-linkbutton" onclick="upgradeCancel();">取消</a>
               <a href="#" class="easyui-linkbutton"  onclick="upgradesubmit();">升级</a> 
             </div>
         </div>
         <div data-options="region:'center'">
             <input class="easyui-textbox" type="hidden" name="apkUrl" id="apkUrlId" />
             <input class="easyui-textbox" type="hidden" name="filePath" id="filePathId" />
             <input class="easyui-textbox" type="hidden" name="mark" id="markId" />
             <table class="easyui-datagrid" id="upgradett"  rownumbers="true" idField="version" singleSelect="true" pagination="true" 
	             fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]" 
	             data-options="method:'get',border:false,fit:true,onDblClickRow:versionDbClick,onLoadSuccess:versionOnLoadSuccess,
	                 fitColumns:true">  
                 <thead>
			         <tr>
			            <th align="center" width="30%" field="version">版本</th>
					    <th align="center" width="70%" field="createTime">创建时间</th>
			         </tr>
                 </thead>   
             </table>
         </div>
    </div>
</div>

<div id="checkBusyWin" class="easyui-window" title="检测忙碌" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:500px;height:200px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true">
            <table>
                <tr>
                    <td align="left">忙碌时间</td>
	                   <td>
	                      <input class="easyui-validatebox" type="text" data-options="required:true" name="busyTime" id="busyTimeId" />
	                   </td>
                </tr> 
                <input id="forType" type="hidden">
           </table>
        <div style="padding: 25px; text-align: center;">
            <a href="#" class="easyui-linkbutton" onclick="cancelCheckBusy();">取消</a>
            <a href="#" class="easyui-linkbutton"  onclick="saveCheckBusy();">确定</a> 
        </div>
    </div>
</div>

<div id="ForWin" class="easyui-window" title="是否强制" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:500px;height:200px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true">
            <table>
                <tr>
                    <td align="left">是否强制</td>
                    <td>
                       <select class="easyui-combobox" id="phoneForce" panelHeight="auto" style="width:155px" >
                                <option value="0">不强制</option>
                                <option value="1">强制</option>
                        </select>
                    </td>
                </tr> 
                <input id="forType" type="hidden">
           </table>
        <div style="padding: 25px; text-align: center;">
            <a href="#" class="easyui-linkbutton" onclick="cancelFor();">取消</a>
            <a href="#" class="easyui-linkbutton"  onclick="saveFor();">确定</a> 
        </div>
    </div>
</div>

<div id="upgradeHeartWin" class="easyui-window" title="升级心跳包" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:500px;height:450px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <div data-options="region:'north'" style="height:110px">
             <form id="upgradeHeartForm"  method="post">
	           <table>
	               <tr>
	                   <td align="left">从版本</td>
	                   <td>
	                      <input class="easyui-textbox" type="text" name="heartfromVersion" id="heartfromVersionId" readonly="true" />
	                   </td>
	                   <td align="left">升级到</td>
	                   <td>
	                       <input class="easyui-textbox" type="text" name="hearttoVersion" id="hearttoVersionId" readonly="true" />
	                   </td>
	               </tr>
	                       <tr>
	                    <td align="left">是否强制</td>
	                    <td>
                           <select class="easyui-combobox" id="heartForce" panelHeight="auto" style="width:155px" >
                                    <option value="0">不强制</option>
                                    <option value="1">强制</option>
                            </select>
                        </td>
                    </tr>  
	           </table>
             </form>
             <div style="padding: 25px; text-align: center;">
               <a href="#" class="easyui-linkbutton"  onclick="upgradeHeartsubmit();">升级</a> 
             </div>
         </div>
         <div data-options="region:'center'">
             <input class="easyui-textbox" type="hidden" name="filePath" id="heartfilePathId" />
             <input class="easyui-textbox" type="hidden" name="heartMd5" id="heartmd5Id" />
             <input class="easyui-textbox" type="hidden" name="bucketName" id="heartbucketNameId" />
             <table class="easyui-datagrid" id="upgradehearttt"  rownumbers="true" idField="version" singleSelect="true" pagination="true" 
	             fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]" 
	             data-options="method:'get',border:false,fit:true,onDblClickRow:heartDbClick,onLoadSuccess:heartOnLoadSuccess,
	                 fitColumns:true">  
                 <thead>
			         <tr>
			            <th align="center" width="30%" field="version">版本</th>
					    <th align="center" width="70%" field="createTime">创建时间</th>
			         </tr>
                 </thead>   
             </table>
         </div>
    </div>
</div>

<div id="upgradeSysApkWin" class="easyui-window" title="升级系统包" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:700px;height:500px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <div data-options="region:'north'" style="height:110px">
             <form id="upgradeSysApkForm"  method="post">
	           <table>
	               <tr>
	                   <td align="left">从版本</td>
	                   <td>
	                      <input class="easyui-textbox" type="text" name="sysApkfromVersion" id="sysApkfromVersionId" readonly="true" />
	                   </td>
	                   <td align="left">升级到</td>
	                   <td>
	                       <input class="easyui-textbox" type="text" name="sysApktoVersion" id="sysApktoVersionId"  readonly="true"/>
	                   </td>
	               </tr>
	                <tr>
	                    <td align="left">是否强制</td>
	                    <td>
                           <select class="easyui-combobox" id="sysApkForce" panelHeight="auto" style="width:155px" >
                                    <option value="0">不强制</option>
                                    <option value="1">强制</option>
                            </select>
                        </td>
                        <td align="left">执行时间(选填)</td>
	                    <td>
                           <input type="text" class="easyui-datetimebox" id="doTime"> </input>
                        </td>
                    </tr> 
                    <tr>
	                    <td align="left">一次执行数量(选填)</td>
	                    <td>
                           <input class="easyui-textbox" type="text" name="doCount" id="doCount"/>
                        </td>
                        <td align="left">执行间隔(分钟 选填）</td>
	                    <td>
                            <input class="easyui-textbox" type="text" name="doTranslate" id="doTranslate"/>
                        </td>
                    </tr>  
                    <tr>
	                    <td align="left">路径</td>
	                    <td>
                           <input class="easyui-textbox" name="sysApkfilePath" id="sysApkfilePathId" readonly="true"/>
                        </td>
                        <td align="left">md5</td>
	                    <td>
                           <input class="easyui-textbox" name="sysApkmd5" id="sysApkmd5Id" readonly="true"/>
                        </td>
                    </tr>  
	           </table>
             </form>
             <div style="padding: 25px; text-align: center;">
               <a href="#" class="easyui-linkbutton"  onclick="upgradeSystemApksubmit();">升级</a> 
             </div>
         </div>
         <div data-options="region:'center'">
             <input class="easyui-textbox" type="hidden" name="sysApkModel" id="sysApkModel" />
             <table class="easyui-datagrid" id="upgradeSysApk"  rownumbers="true" idField="version" singleSelect="true" pagination="true" 
	             fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]" 
	             data-options="method:'get',border:false,fit:true,onDblClickRow:sysApkDbClick,onLoadSuccess:sysApkOnLoadSuccess,
	                 fitColumns:true">  
                 <thead>
			         <tr>
			            <th align="center" width="30%" field="version">版本</th>
					    <th align="center" width="70%" field="createTime">创建时间</th>
			         </tr>
                 </thead>   
             </table>
         </div>
    </div>
</div>


<div id="upgradeSysApkByTypeWin" class="easyui-window" title="升级系统包" closed="true" collapsible="false" minimizable="false"  maximizable="false" style="width:700px;height:500px"   
        data-options="iconCls:'icon-save',modal:true">
     <div fit="true" class="easyui-layout">
         <div data-options="region:'north'" style="height:110px">
             <form id="upgradeSysApkFormByType"  method="post">
	           <table>
	               <tr>
	                   <td align="left">选择手机类型</td>
	                   <td>
	                       <select class="easyui-combobox" id="modelByType" panelHeight="auto" style="width:170px" >
	                                <option value="-1">请选择</option>
                                    <option value="Redmi Note 4">Redmi Note 4</option>
                                    <option value="K5703QS">K5703QS</option>
                            </select>
	                   </td>
	                   <td align="left">升级到</td>
	                   <td>
	                       <input class="easyui-textbox" type="text" name="sysApktoVersionByType" id="sysApktoVersionByType"  readonly="true"/>
	                   </td>
	               </tr>
	                <tr>
	                    <td align="left">是否强制</td>
	                    <td>
                           <select class="easyui-combobox" id="sysApkForceByType" panelHeight="auto" style="width:170px" >
                                    <option value="0">不强制</option>
                                    <option value="1">强制</option>
                            </select>
                        </td>
                        <td align="left">执行时间(选填)</td>
	                    <td>
                           <input type="text" class="easyui-datetimebox" id="doTimeByType"> </input>
                        </td>
                    </tr> 
                    <tr>
	                    <td align="left">一次执行数量(选填)</td>
	                    <td>
                           <input class="easyui-textbox" type="text" name="doCount" id="doCountByType"/>
                        </td>
                        <td align="left">执行间隔(分钟 选填）</td>
	                    <td>
                            <input class="easyui-textbox" type="text" name="doTranslate" id="doTranslateByType"/>
                        </td>
                    </tr> 
                    <tr>
	                    <td align="left">url</td>
	                    <td>
                            <input class="easyui-textbox" name="sysApkfilePath" id="sysApkfilePathIdByType"  readonly="true"/>
                        </td>
                        <td align="left">md5</td>
	                    <td>
                            <input class="easyui-textbox"  name="sysApkmd5" id="sysApkmd5IdByType" readonly="true"/>
                        </td>
                    </tr>   
	           </table>
             </form>
             <div style="padding: 25px; text-align: center;">
               <a href="#" class="easyui-linkbutton"  onclick="upgradeSystemApksubmitByType();">升级</a> 
             </div>
         </div>
         <div data-options="region:'center'">
             <table class="easyui-datagrid" id="upgradeSysApkByType"  rownumbers="true" idField="version" singleSelect="true" pagination="true" 
	             fitColumns="true" pageSize="15" pageList="[15,30,60,80,100]" 
	             data-options="method:'get',border:false,fit:true,onDblClickRow:sysApkDbClickType,
	                 fitColumns:true">  
                 <thead>
			         <tr>
			            <th align="center" width="30%" field="version">版本</th>
					    <th align="center" width="70%" field="createTime">创建时间</th>
			         </tr>
                 </thead>   
             </table>
         </div>
    </div>
</div>
</body>
</html>